package lagou.MapTest.ListTest;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapTest {
    public static void main(String[] args) {
        Map<String,String> map1 = new HashMap<>();
        map1.put("name","yankun");
        map1.put("sex","man");
        System.out.println(map1);//{sex=man, name=yankun}
        System.out.println("________________");
        String str1 = map1.get("name");
        System.out.println(str1);
        boolean b1 = map1.containsKey("age");
        boolean b2 = map1.containsValue("yankun");
        System.out.println(b1+""+b2);
        System.out.println("________________");
        Set<String> arr = map1.keySet();
        for (Object ts : arr){
            System.out.println(ts);
        }
        Set<Map.Entry<String, String>> entries = map1.entrySet();
        for (Map.Entry<String, String> ts : entries){
            System.out.println(ts);
        }

    }
}
